package com.stone.core

import android.content.Context
import com.tencent.tddiag.logger.TDLog
import com.tencent.tddiag.logger.TDLogConfig
import com.tencent.tddiag.protocol.LogLevel

object HiLogger {


    fun init(context: Context, logPath: String, isDebug: Boolean = BuildConfig.DEBUG){
        val logConfig =  TDLogConfig.Builder(context)
            .setLogPath(logPath) // 日志输出目录，需提前获取写权限
            .setLogLevel(LogLevel.DEBUG) // 默认VERBOSE
            .setConsoleLog(isDebug) // 默认true
            .build()
        TDLog.initialize(context, logConfig);
    }




    fun v(tag: String, msg: String){
        TDLog.v(tag, msg)
    }

    fun d(tag: String, msg: String){
        TDLog.d(tag, msg)
    }

    fun i(tag: String, msg: String){
        TDLog.i(tag, msg)
    }

    fun w(tag: String, msg: String){
        TDLog.w(tag, msg)
    }

    fun e(tag: String, msg: String){
        TDLog.e(tag, msg)
    }

    fun e(tag: String, msg: String, e: Throwable){
        TDLog.e(tag, msg, e)
    }






}